//
//  AccountOverviewViewController.m
//  Kjs-iOS
//
//  Created by 江伟 on 16/7/10.
//  Copyright © 2016年 jmhz. All rights reserved.
//

#import "AccountOverviewViewController.h"

@interface AccountOverviewViewController ()
@property (nonatomic,assign) IBOutlet UILabel* totalAssetsLab;
@property (nonatomic,assign) IBOutlet UILabel* availablebalanceLab;
@property (nonatomic,assign) IBOutlet UILabel* blockedBalanceLab;
@property (nonatomic,assign) IBOutlet UILabel* totalBondInvestBackLab;
@property (nonatomic,assign) IBOutlet UILabel* totalBondInvestIncomeLab;
@property (nonatomic,assign) IBOutlet UILabel* totalBondInvestIncomeReceivableLab;
@property (nonatomic,assign) IBOutlet UILabel* bondInvestLab;
@property (nonatomic,assign) IBOutlet UILabel* totalBondRaiseRepayLab;
@property (nonatomic,assign) IBOutlet UILabel* totalBondRaiseInterestRepayLab;
@property (nonatomic,assign) IBOutlet UILabel* totalBondRaisePrincipleStillLab;
@property (nonatomic,assign) IBOutlet UILabel* totalBondRaiseInterestStillLab;
@property (nonatomic,assign) IBOutlet UILabel* totalReceivableLab;
@property (nonatomic,assign) IBOutlet UILabel* totalStillLab;
@end

@implementation AccountOverviewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationItem setTitle:@"账户总览"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
    formatter.numberStyle = NSNumberFormatterDecimalStyle;
    NSString *totalAssets = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.userVirtualAccount.totalAssets]];
    NSString *availablebalance = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.userVirtualAccount.availablebalance]];
    NSString *blockedBalanceLab = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.userVirtualAccount.blockedBalance]];
    NSString *totalBondInvestBack = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.userVirtualAccount.totalBondInvestBack]];
    NSString *totalBondInvestIncome = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.userVirtualAccount.totalBondInvestIncome]];
    NSString *totalBondInvestIncomeReceivable = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.userVirtualAccount.totalBondInvestIncomeReceivable]];
    NSString *bondInvest = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.userVirtualAccount.bondInvest]];
    NSString *totalBondRaiseRepay = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.userVirtualAccount.totalBondRaiseRepay]];
    NSString *totalBondRaiseInterestRepay = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.userVirtualAccount.totalBondRaiseInterestRepay]];
    NSString *totalBondRaisePrincipleStill = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.userVirtualAccount.totalBondRaisePrincipleStill]];
    NSString *totalBondRaiseInterestStill = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.userVirtualAccount.totalBondRaiseInterestStill]];
    NSString *totalReceivable = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.totalReceivable]];
    NSString *totalStill = [formatter stringFromNumber:[NSNumber numberWithDouble:self.userVirtualAccountModel.totalStill]];

    self.totalAssetsLab.text = [NSString stringWithFormat:@"¥%@",totalAssets];
    self.availablebalanceLab.text = [NSString stringWithFormat:@"¥%@",availablebalance];
    self.blockedBalanceLab.text = [NSString stringWithFormat:@"¥%@",blockedBalanceLab];
    self.totalBondInvestBackLab.text = [NSString stringWithFormat:@"¥%@",totalBondInvestBack];
    self.totalBondInvestIncomeLab.text = [NSString stringWithFormat:@"¥%@",totalBondInvestIncome];
    self.totalBondInvestIncomeReceivableLab.text = [NSString stringWithFormat:@"¥%@",totalBondInvestIncomeReceivable];
    self.bondInvestLab.text = [NSString stringWithFormat:@"¥%@",bondInvest];
    self.totalBondRaiseRepayLab.text = [NSString stringWithFormat:@"¥%@",totalBondRaiseRepay];
    self.totalBondRaiseInterestRepayLab.text = [NSString stringWithFormat:@"¥%@",totalBondRaiseInterestRepay];
    self.totalBondRaisePrincipleStillLab.text = [NSString stringWithFormat:@"¥%@",totalBondRaisePrincipleStill];
    self.totalBondRaiseInterestStillLab.text = [NSString stringWithFormat:@"¥%@",totalBondRaiseInterestStill];
    self.totalReceivableLab.text = [NSString stringWithFormat:@"¥%@",totalReceivable];
    self.totalStillLab.text = [NSString stringWithFormat:@"¥%@",totalStill];
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
